package cn.stylefeng.guns.sys.modular.api.controller;

import cn.stylefeng.guns.sys.modular.system.service.UPayService;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 银联支付控制器
 * @author zhou
 * @date 2019-7-30 10:34:24
 */
@RestController
public class UPayController {
    @Autowired
    private UPayService uPayService;

    private final static Logger LOGGER = LoggerFactory.getLogger(UPayController.class);
    @RequestMapping("/pay/u")
    public Map<String, Object> pay(String amount, String extNo) {
        LOGGER.info("银联支付controller请求开始");
        Map<String, Object> resultMap = uPayService.pay(amount, extNo);
        LOGGER.info("银联支付controller请求结果:{}", JSON.toJSONString(resultMap));
        return resultMap;
    }

}
